//
//  AdressInputTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/28.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "AdressInputTableViewCell.h"

@interface AdressInputTableViewCell ()

@end

@implementation AdressInputTableViewCell{
    
    NSArray * placeStrArr;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.inputTextField = [[GLGWTextField alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(15), 0, KScreenWidth - kWidthProportion_In_iPhoneTriploid(30), self.contentView.height) titlePlaceholder:@"" theFont:SYSTEMFONT(14) theTitColor:kColor_Rule_Black inSuperView:self.contentView];
        self.inputTextField.delegate = nil;
        [self.inputTextField addTarget:self action:@selector(textField1TextChange:) forControlEvents:UIControlEventEditingChanged];
    }
    return self;
}

-(void)setRowNumPath:(NSIndexPath *)rowNumPath{
    _rowNumPath = rowNumPath;
}
//服务
-(void)setService_Model:(ServiceBuyersModel_Infos *)service_Model{
    _service_Model = service_Model;
    switch (_rowNumPath.section) {
        case 0:{
            self.inputTextField.text = _service_Model.enterpriseName;
        }
            break;
        case 1:{
            if (_rowNumPath.row == 0) {
                self.inputTextField.text = _service_Model.receiverName;
            }else if (_rowNumPath.row == 1){
                self.inputTextField.text = _service_Model.receiverPhone;
            }
        }
            break;
            
        default:
            break;
    }
}
//地址
-(void)setIn_Model:(MyAdressModel_Infos *)in_Model{
    _in_Model = in_Model;
    switch (_rowNumPath.row) {
        case 0:{
            self.inputTextField.text = _in_Model.consignee;
        }
            break;
        case 1:{
            self.inputTextField.text = _in_Model.phone;
        }
            break;
        case 2:{
            self.inputTextField.text = _in_Model.tel;
        }
            break;
            
        default:
            break;
    }
}

-(void)textField1TextChange:(GLGWTextField *)textField{
    if (self.Block_AdressChange) {
        self.Block_AdressChange(textField.text);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
